package consultan.vanke.com.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import consultan.vanke.com.R;
import consultan.vanke.com.adapter.CommonAdapter;
import consultan.vanke.com.adapter.ViewHolder;

public class BaoFragment extends BaseFragment {
    @BindView(R.id.recy_list)
    RecyclerView recyList;
    private CommonAdapter<String> adapterCenter;
    private List<String> subjectsBeansCenter = new ArrayList<>();

    @Override
    protected void initViews() {

    }

    @Override
    protected void initDatas() {
        recyList.setLayoutManager(new LinearLayoutManager(_mActivity));
        subjectsBeansCenter.add("");
        subjectsBeansCenter.add("");
        subjectsBeansCenter.add("");
        adapterCenter = new CommonAdapter<String>(_mActivity, subjectsBeansCenter, R.layout.bao_item) {
            @Override
            public void onBindViewHolder(ViewHolder holder, int position) {
                super.onBindViewHolder(holder, position);
            }

            @Override
            public void convert(ViewHolder holder, String assetBean) {
                LinearLayout linear_all = holder.getView(R.id.linear_all);
                if (holder.getAdapterPosition() == 0) {
                    linear_all.setBackground(getResources().getDrawable(R.mipmap.edit_1));
                } else if (holder.getAdapterPosition() == 1) {
                    linear_all.setBackground(getResources().getDrawable(R.mipmap.edit_2));
                } else if (holder.getAdapterPosition() == 2) {
                    linear_all.setBackground(getResources().getDrawable(R.mipmap.edit_3));
                }

            }

        };
        recyList.setAdapter(adapterCenter);
    }

    @Override
    protected void initEvents() {

    }

    @Override
    protected View initContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return View.inflate(_mActivity, R.layout.bao_fragment, null);
    }

}
